//
//  WATransactionCell.m
//  WalkiOS
//
//  Created by luqiuan on 2019/10/17.
//  Copyright © 2019 Chenmuzhou. All rights reserved.
//

#import "WATransactionCell.h"

@implementation WATransactionCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];
}

- (void)configWithModel:(WAGoodListModel *)model type:(NSInteger)type{
    _model = model;
    _type = type;
    self.buyorLB.text = [NSString stringWithFormat:@"订单编号：%zd",model.ID];
    self.sellorLB.text = [NSString stringWithFormat:@"交易数量：%zd枚",model.number];
    
    
    self.detailLB.text = [NSString stringWithFormat:@"交易单价：RM%@",[NSString baoliuliangwei:[@(model.price) stringValue]]];
    
//    self.detailLB.text = [NSString baoliuliangwei:[@(model.price) stringValue]];

    self.button.userInteractionEnabled = NO;
    if(model.status == 0){
        [self.button setTitle:@"取消" forState:0];
        self.button.userInteractionEnabled = YES;
    }
    else if(model.status == 3){
        [self.button setTitle:@"已完成" forState:0];
    }
    else if(model.status == 4){
        [self.button setTitle:@"已取消" forState:0];
    }
    else{
        [self.button setTitle:@"查看" forState:0];
    }
}

- (IBAction)buttonACtion:(id)sender {
    if (self.buttonActionBlock) {
        self.buttonActionBlock(self.model);
    }
}
@end
